//个人击杀数据(击杀、助攻、死亡)
import * as echarts from "echarts";
import store from "../store";
let playername = store.getters.getPlayerName
let playerkills = store.getters.getPlayerKills
let playerAssists = store.getters.getPlayerAssists
let playerDeaths = store.getters.getPlayerDeaths

let option = {
  tooltip: {
    trigger: "axis",
    axisPointer: {
      lineStyle: {
        color: "#57617B",
      },
    },
  },
  legend: {
    icon: "circle",
    itemWidth: 14,
    itemHeight: 5,
    itemGap: 13,
    data: ["总击杀", "总助攻", "总死亡"],
    right: "center",
    textStyle: {
      fontSize: 14,
      color: "#FFF",
    },
  },
  grid: {
    left: "3%",
    right: "4%",
    bottom: "10%",
    top: "18%",
    containLabel: true,
  },
  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      axisTick: {
        show: false,
      },
      axisLine: {
        lineStyle: {
          color: "#26282f",
        },
      },
      axisLabel:{
        color:"#FFF"
      },
      data: [...playername],
    },
  ],
  yAxis: [
    {
      type: "value",
      splitNumber: 5,
      axisTick: {
        show: false,
      },
      axisLabel: {
        margin: 10,
        color: "#ccc2c2",
        textStyle: {
          fontSize: 13,
        },
      },
      splitLine: {
        lineStyle: {
          color: "#3d4559",
        },
      },
    },
  ],

  dataZoom: [
    //滚动条
    {
      type: "slider",
      startValue: 0,
      endValue: 14,
      yAxisIndex: [0],
      bottom: "10",
      left: "20",
      height: 6,
      borderColor: "rgba(0,0,0,0)",
      showDetail: false, //即拖拽时候是否显示详细数值信息 默认true
    },
    {
      type: "inside",  // 支持内部鼠标滚动平移
      yAxisIndex: [0 ,1],
      zoomOnMouseWheel: false,  // 开启滚轮缩放
      moveOnMouseMove: true, //鼠标滚轮触发滚动
      moveOnMouseWheel: true,
    }
  ],

  series: [
    {
      name: "总击杀",
      type: "line",
      smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          width: 1,
        },
      },
      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1,
            [
              {
                offset: 0,
                color: "rgba(137, 189, 27, 0.3)",
              },
              {
                offset: 0.8,
                color: "rgba(137, 189, 27, 0)",
              },
            ],
            false
          ),
          shadowColor: "rgba(0, 0, 0, 0.1)",
          shadowBlur: 10,
        },
      },
      itemStyle: {
        normal: {
          color: "rgb(137,189,27)",
          borderColor: "rgba(137,189,2,0.27)",
          borderWidth: 12,
        },
      },
      data: [...playerkills],
    },
    {
      name: "总助攻",
      type: "line",
      smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          width: 1,
        },
      },
      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            [
              {
                offset: 0,
                color: "rgba(0, 136, 212, 0.3)",
              },
              {
                offset: 0.8,
                color: "rgba(0, 136, 212, 0)",
              },
            ],
            false
          ),
          shadowColor: "rgba(0, 0, 0, 0.1)",
          shadowBlur: 10,
        },
      },
      itemStyle: {
        normal: {
          color: "rgb(0,136,212)",
          borderColor: "rgba(0,136,212,0.2)",
          borderWidth: 12,
        },
      },
      data: [...playerAssists],
    },
    {
      name: "总死亡",
      type: "line",
      smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          width: 1,
        },
      },
      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            [
              {
                offset: 0,
                color: "rgba(219, 50, 51, 0.3)",
              },
              {
                offset: 0.8,
                color: "rgba(219, 50, 51, 0)",
              },
            ],
            false
          ),
          shadowColor: "rgba(0, 0, 0, 0.1)",
          shadowBlur: 10,
        },
      },
      itemStyle: {
        normal: {
          color: "rgb(219,50,51)",
          borderColor: "rgba(219,50,51,0.2)",
          borderWidth: 12,
        },
      },
      data: [...playerDeaths],
    },
  ],
};
export {option}
